package com.example.mycamerademo

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding


/**
 * @author tgw
 * @date 2021/6/10
 * @describe
 */
abstract class BaseViewBindActivity<VB : ViewDataBinding> : AppCompatActivity(){


    protected lateinit var mBind: VB


    abstract fun getLayoutInflateId(): Int


    abstract fun initData()

    abstract fun initUI()



    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        mBind = DataBindingUtil.setContentView(
            this,
            getLayoutInflateId()
        )
        initData()
        initUI()
    }

}